Skip to content

Conversation

@joshuarli
Copy link
Member

building mkdocs-material (in #1610) fails since the wheel ends up with py311-none-any tag - which afaict is within spec so we should do a broader compat check than == "py3"

anthony says "it's within spec but nothing should ever produce a wheel like this / why are we getting such a weird wheel?"

i'm not sure if it's a big deal - it is within the spec

Comment on lines +59 to +61
if tag not in packaging.tags.compatible_tags(py):
raise AssertionError(f"{tag} is not compatible with python {py}")
ret.update(_py_exe(*py) for py in PYTHONS)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential bug: The logic for py3 tags incorrectly raises an AssertionError on incompatibility, causing crashes, and also redundantly adds all Python versions to the result set on each successful check.
  • Description: The logic for handling tags starting with py3 is flawed in two ways. First, it raises an AssertionError if a version-specific tag (e.g., py311-none-any) is found to be incompatible with any of the Python versions being checked (e.g., 3.12), causing the validation to crash for valid wheels. Second, if a tag is compatible, the code proceeds to add all Python versions to the result set via ret.update(_py_exe(*py) for py in PYTHONS). This ignores the specific version py that was just checked and leads to redundant operations within the loop.

  • Suggested fix: The loop should be refactored to only add Python versions that are compatible with the tag, without raising an error for incompatibilities. This can be achieved by checking for compatibility and then using ret.add(_py_exe(*py)) to add only the specific matching version py inside the conditional block.
    severity: 0.85, confidence: 0.99

Did we get this right? 👍 / 👎 to inform future reviews.

@joshuarli joshuarli merged commit eac0948 into main Sep 25, 2025
15 checks passed
@joshuarli joshuarli deleted the less-strict-interpreter-tag branch September 25, 2025 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants